import React from "react";
import { StyleSheet, View, ActivityIndicator } from "react-native";

const Loading = ({ style = {}, size = "small", color = null, children }) => (
  <View style={{ ...styles.container, ...style }}>
    <ActivityIndicator size={size} color={color} />
    {children || null}
  </View>
);

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: "center",
    justifyContent: "center",
  },
});

export default Loading;
